# -*- coding: utf-8 -*-
import traceback

def error():
    '''
    捕获用例执行异常
    :return:
    '''
    def Error(func):
        def wrapper(*args,**kwargs):
            try:
                return func(*args,**kwargs)
            except Exception as e:
                error_msg = traceback.format_exc()
                # print(error_msg)
                raise Exception(error_msg)
        return wrapper
    return Error